package cn.com.infohold.smartcity.api;

import android.support.annotation.Keep;

import java.io.File;

import cn.com.infohold.smartcity.BuildConfig;
import library.http.annotations.BaseUrl;
import library.http.annotations.Debuggable;
import library.http.annotations.GET;
import library.http.annotations.Multipart;
import library.http.annotations.POST;
import library.http.annotations.Part;
import library.http.annotations.Proxy;
import library.http.annotations.Query;
import library.http.annotations.Timeout;

/**
 * Created by Mr.Fan on 2017/3/25.
 */

@Keep
@BaseUrl(BuildConfig.API_FILE_URL)
//@SslKey(path = "ssl/client.p12", pwd = "123456", keyType = "PKCS12")
//@SslTrust(path = "ssl/client.bks", pwd = "123456", keyType = "bks")
@Proxy(host = library.BuildConfig.BUILD_IP, port = 8888)
@Timeout(connect = 10000, write = 10000, read = 10000)
public interface FileAPI {
    /**
     * 获取上传路径
     *
     * @param num
     * @param type
     * @param suffix
     * @return
     */
    @GET("filemanager/filePathServlet")
    HttpHook<String> getfilePath(@Query("num") int num, @Query("type") String type, @Query("suffix") String suffix);

    @POST("/partselection/common/uploadImage.do")
    @Multipart
    @Debuggable()
    HttpHook<String> uploadImage(@Part("type") String type, @Part("file") File file, @Part("path") String path);

}
